package com.itboye.eweilisten.me.home;

import android.os.Bundle;
import android.widget.LinearLayout;

import com.itboye.eweilisten.R;
import com.itboye.eweilisten.base.BaseActivity;
import com.itboye.eweilisten.model.TextABean;
import com.itboye.eweilisten.presenter.UserPresenter;
import com.itboye.eweilisten.volley.ResultEntity;

import java.util.Observable;
import java.util.Observer;

/**
 * Created by itboye on 2017/4/1.
 */

public class ActivityTextA extends BaseActivity implements Observer {

    UserPresenter presenter;
    TextABean bean;
    LinearLayout linearLayout;


    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        setContentView(R.layout.activity_unti_texta);
        bean = new TextABean();
        presenter = new UserPresenter(this);
        presenter.onTimu("171", "9", "itboye");


    }

    @Override
    public void update(Observable o, Object arg) {
        ResultEntity entity = handlerError(arg);
        if (entity != null) {
            if (entity.getEventType() == presenter.TextA_success) {
                bean = (TextABean) entity.getData();
//                for (int i = 0; i < bean.getList().size(); i++) {
//                    TextView text = new TextView(this);
//                    text.setTextColor(Color.BLACK);
//                    text.setTextSize(20);
//                    text.setText(bean.getList().get(i).getNote());
//                    linearLayout.addView(text);
//                }
                closeProgressDialog();
            }
        }
    }
}
